'\" t
.\"     Title: ne_strparam
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 23 November 2024
.\"    Manual: neon API reference
.\"    Source: neon 0.34.0
.\"  Language: English
.\"
.TH "NE_STRPARAM" "3" "23 November 2024" "neon 0.34.0" "neon API reference"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ne_strparam \- HTTP extended parameter value encoding
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <ne_string\&.h>
.fi
.ft
.HP \w'char\ *ne_strparam('u
.BI "char *ne_strparam(const\ char\ *" "charset" ", const\ char\ *" "lang" ", const\ char\ *" "value" ");"
.SH "DESCRIPTION"
.PP
The
\fBne_strparam\fR
function can be used to encode an extended parameter value for an HTTP header, as defined in RFC 5987\&. The function takes as arguments the
\fIvalue\fR
to encode, using a given MIME
\fIcharset\fR
character set, and
\fIlang\fR
language tag\&. The extended parameter encoding is used in HTTP protocol specifications to allow easily embedding special characters (such as quote marks, separators or non\-ASCII) in header values\&.
.PP
In accordance with RFC 5987, the
\fIcharset\fR
argument must be either
\fB"UTF\-8"\fR
or
\fB"IS0\-8859\-1"\fR, but the
\fIlang\fR
argument may be
NULL\&.
.SH "RETURN VALUE"
.PP
The return value is either:
.PP
NULL
.RS 4
if the value parameter is a "regular parameter" and does not need extended encoding
.RE
.PP
non\-NULL
.RS 4
the encoding of the input value as an extended parameter as a NUL\-terminated, malloc\-allocated string
.RE
.SH "HISTORY"
.PP
\fBne_strparam\fR
is available in neon 0\&.32\&.0 and later\&.
.SH "SEE ALSO"
.PP
\m[blue]\fB\%https://tools.ietf.org/html/rfc5987\fR\m[]
.SH "COPYRIGHT"
.br
Copyright \(co 2001-2024 Joe Orton
.br
